<template>
  <div>
    <h1>Child</h1>
    <p>child count is {{ count }}</p>
  </div>
</template>

<script setup>
import { ref } from 'vue'

const count = ref(20)

const changeCount = val => {
  count.value = val
}
// 子组件中暴露内容给父组件
defineExpose({
  changeCount
})
</script>

<style scoped></style>
